import Main from '@/view/main'
import parentView from '@/components/parent-view'

export default [{
    path: '/',
    name: '_home',
    redirect: '/home',
    component: Main,
    meta: {
      hideInMenu: true,
      notCache: true
    },
    children: [{
      path: '/home',
      name: 'home',
      meta: {
        hideInMenu: true,
        title: '首页',
        notCache: true
      },
      component: () =>
        import('@/view/home/home')
    }]
  },
  {
    path: '/login',
    name: 'login',
    meta: {
      title: '登录',
      hideInMenu: true
    },
    component: () =>
      import('@/view/login/login.vue')
  },
  {
    path: '/appuser_manage',
    name: 'appuser_manage',
    meta: {
      icon: 'ios-people',
      title: '用户管理',
      showAlways: true,
      access: ['user_manage']
    },
    component: Main,
    children: [{
        path: 'user_manage',
        name: 'user_manage',
        meta: {
          title: '用户列表'
        },
        component: () =>
          import('@/view/user-manage/appuser-list/appuser-list.vue')
      },
      {
        path: 'user_bonus',
        name: 'user_bonus',
        meta: {
          title: '用户奖励额'
        },
        component: () =>
          import('@/view/user-manage/appuser-bonus/appuser-bonus.vue')
      },
      {
        path: 'user_integral',
        name: 'user_integral',
        meta: {
          title: '用户消费积分'
        },
        component: () =>
          import('@/view/user-manage/appuser-integral/appuser-integral.vue')
      }
    ]
  },
  {
    path: '/seller_manage',
    name: 'seller_manage',
    meta: {
      icon: 'md-appstore',
      title: '商家管理',
      showAlways: true
    },
    component: Main,
    children: [{
        path: 'seller_list',
        name: 'seller_list',
        meta: {
          title: '商家列表'
        },
        component: () =>
          import('@/view/seller-manage/seller-list/seller-list.vue')
      },
      {
        path: 'seller_audit',
        name: 'seller_audit',
        meta: {
          title: '商家申请'
        },
        component: () =>
          import('@/view/seller-manage/seller-audit/seller-audit.vue')
      },
      {
        path: 'seller_classify',
        name: 'seller_classify',
        meta: {
          title: '商家类型'
        },
        component: () =>
          import('@/view/seller-manage/seller-classify/seller-classify.vue')
      }
    ]
  },
  {
    path: '/goods_manage',
    name: 'goods_manage',
    meta: {
      icon: 'md-basket',
      title: '商品管理',
      showAlways: true
    },
    component: Main,
    children: [{
        path: 'goods_classify',
        name: 'goods_classify',
        meta: {
          title: '商品分类'
        },
        component: () =>
          import('@/view/goods-manage/goods-classify/goods-classify.vue')
      },
      {
        path: 'goods_list',
        name: 'goods_list',
        meta: {
          title: '商品列表'
        },
        component: () =>
          import('@/view/goods-manage/goods-list/goods-list.vue')
      },
      {
        path: 'goods_comment',
        name: 'goods_comment',
        meta: {
          title: '商品评价'
        },
        component: () =>
          import('@/view/goods-manage/goods-comment/goods-comment.vue')
      }
    ]
  },
  {
    path: '',
    meta: {
      hideInMenu: true,
      notCache: true
    },
    component: Main,
    children: [{
      path: '/goods_manage/goods_list/add_goods',
      name: 'add_goods',
      meta: {
        title: '新增商品'
      },
      component: () =>
        import('@/view/goods-manage/goods-list/add/add.vue')
    }]
  },
  {
    path: '',
    meta: {
      hideInMenu: true,
      notCache: true
    },
    component: Main,
    children: [{
      path: '/goods_manage/goods_list/edit_goods',
      name: 'edit_goods',
      meta: {
        title: '编辑商品'
      },
      component: () =>
        import('@/view/goods-manage/goods-list/edit/edit.vue')
    }]
  },
  {
    path: '/system_manage',
    name: 'system_manage',
    meta: {
      icon: 'md-settings',
      title: '系统管理',
      showAlways: true
      // access: ['system_manage']
    },
    component: Main,
    children: [{
        path: 'sysuser_manage',
        name: 'sysuser_manage',
        meta: {
          title: '系统用户管理',
          access: ['sysuser_manage']
        },
        component: () =>
          import('@/view/system-manage/sysuser-manage/sysuser-manage.vue')
      },
      {
        path: 'role_manage',
        name: 'role_manage',
        meta: {
          title: '角色管理',
          access: ['role_manage']
        },
        component: () =>
          import('@/view/system-manage/role-manage/role-manage.vue')
      }
    ]
  },
  {
    path: '',
    name: '_menu_tree',
    meta: {
      hideInMenu: true,
      notCache: true
    },
    component: Main,
    children: [{
      path: '/system_manage/role_manage/menu_tree',
      name: 'menu_tree',
      meta: {
        icon: 'ios-list-box',
        title: '菜单列表',
        access: ['menu_tree']
      },
      component: () =>
        import('@/view/system-manage/role-manage/component/tree/tree.vue')
    }]
  },
  {
    path: '/feedback',
    name: 'feedback',
    meta: {
      icon: 'ios-paper',
      title: '意见反馈',
      access: ['feedback']
    },
    component: Main,
    children: [{
      path: 'feedback_index',
      name: 'feedback_index',
      meta: {
        icon: 'ios-paper',
        title: '意见反馈'
      },
      component: () =>
        import('@/view/feedback/feedback.vue')
    }]
  },
  {
    path: '/news',
    name: 'news',
    meta: {
      icon: 'md-notifications',
      title: '消息中心',
      access: ['news']
    },
    component: Main,
    children: [{
      path: 'news_center',
      name: 'news_center',
      meta: {
        icon: 'md-notifications',
        title: '消息中心'
      },
      component: () =>
        import('@/view/news-center/news-center.vue')
    }]
  },
  {
    path: '/components',
    name: 'components',
    meta: {
      icon: 'logo-buffer',
      title: '组件',
      access: ['components']
    },
    component: Main,
    children: [{
        path: 'upload_excel',
        name: 'upload_excel',
        meta: {
          title: '导入EXCEL'
        },
        component: () =>
          import('@/view/excel/upload-excel.vue')
      },
      {
        path: 'upload_img',
        name: 'upload_img',
        meta: {
          title: '上传图片'
        },
        component: () =>
          import('@/view/upload/upload-img/upload-img.vue')
      }
    ]
  },
  {
    path: '/401',
    name: 'error_401',
    meta: {
      hideInMenu: true
    },
    component: () =>
      import('@/view/error-page/401.vue')
  },
  {
    path: '/500',
    name: 'error_500',
    meta: {
      hideInMenu: true
    },
    component: () =>
      import('@/view/error-page/500.vue')
  },
  {
    path: '*',
    name: 'error_404',
    meta: {
      hideInMenu: true
    },
    component: () =>
      import('@/view/error-page/404.vue')
  }
]
